package com.zjtaixue.usersite.mapper;

import com.zjtaixue.usersite.domain.Login;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface LoginMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Login record);

    Login selectByPrimaryKey(Integer id);

    List<Login> selectAll();

    int updateByPrimaryKey(Login record);

    Login teacherLogin(Login login);

    Login studentLogin(Login login);

    int enable(Integer loginId);

    int disable(Integer loginId);

    /**
     * 根据用户名，查询当前用户
     * @param username
     * @return
     */
    Login getByUsername(String username);

    int deleteByUserInfoAndType(@Param("userInfoId") Integer userInfoId, @Param("type") Byte type);

    Login findByUserInfoAndType(@Param("userInfoId") Integer userInfoId, @Param("type") Byte type);

    List<Login> listByUserInfoId(@Param("userInfoId") Integer userInfoId, @Param("type") Byte type);
}